//
//  StoreInfoController.m
//  DMGME
//
//  Created by ihope99 on 15/9/17.
//  Copyright (c) 2015年 GYP. All rights reserved.
//

#import "StoreInfoController.h"
#import "UIImageView+WebCache.h"
#import "DMStoreInfoController.h"

@interface StoreInfoController ()

@end

@implementation StoreInfoController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [self storeShopInfoNet];

}
- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.title = @"查看店铺信息";
    [self AddLeftImageBtn:[UIImage imageNamed:@"fanhui_03 2"]target:self action:@selector(GoBack)];

    [_exChangeStoreInfoBtn addTarget:self action:@selector(exChangeStoreInfoBtnClick) forControlEvents:UIControlEventTouchUpInside];
    
}

- (void)exChangeStoreInfoBtnClick{
    DMStoreInfoController *dMStoreInfoC = [[DMStoreInfoController alloc] init];
    dMStoreInfoC.exchangShopType = @"ex";
    [self.navigationController pushViewController:dMStoreInfoC animated:YES];
    
}

- (void)storeShopInfoNet{
    NSMutableDictionary *dict = [NSMutableDictionary dictionary];
    [dict setValue: [AFDownManager MD5String:@"%^&*dongmangoug!@#$getShop"] forKey:@"token"];
    [dict setValue: @"getShop" forKey:@"action"];
    [dict setValue: kkUserDict[@"id"] forKey:@"agent_id"];
    [AFDownManager POST:UpShopPitch parameters:dict success:^(id responseObject) {
//        NSLog(@"%@",responseObject);
        if ([responseObject[@"data"][@"shoptype"] isKindOfClass:[NSNull class]]) {
            return ;
        }
        
        _storeNameLable.text = [NSString stringWithFormat:@"店铺名称:  %@",responseObject[@"data"][@"storename"]];
        _storeAdressLable.text = [NSString stringWithFormat:@"%@\n",responseObject[@"data"][@"address"]] ;
        _bossNameLable.text = [NSString stringWithFormat:@"老板姓名:  %@",responseObject[@"data"][@"realname"]];
        _mobleNumLable.text = [NSString stringWithFormat:@"手机号:  %@",responseObject[@"data"][@"phone"]];
        _storeTypeLable.text = [NSString stringWithFormat:@"店铺类别:  %@",responseObject[@"data"][@"shoptype"][@"title"]];
        _storecolatian.text =[NSString stringWithFormat:@"上传店铺坐标: %@,%@",responseObject[@"data"][@"lat"],responseObject[@"data"][@"lng"]] ;
        
//        NSLog(@"%@",responseObject[@"data"][@"cover"]);
        
         [_storeImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",responseObject[@"data"][@"cover"]]] placeholderImage:nil];
    } failure:^(NSError *error) {
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
